<template>
    <!--发货地-->
    <div id="ShipAddressDetails">
        <v-details :detailData="inputData" :inputConfig="inputConfig" @pop="setData"></v-details>
    </div>
</template>

<script>
import details from 'commons/Detail'
import baseMixin from "@/mixins/BaseMixin";

export default {
    name: "ShipAddressDetails",
    mixins: [baseMixin],
    props: {
        inputData: {
            type: Object
        }
    },

    data() {
        return {
            inputConfig: [
                [
                    {
                        type: "table",
                        label: this.$t('config.supplier'),
                        props: "sellername",
                        tableConfig: [
                            {
                                label: this.$t('config.supplier'),
                                prop: "storerkey",
                                input: "input",
                            },
                            {
                                label: this.$t('config.company'),
                                prop: "company",
                                input: "input",
                            },
                            {
                                label: this.$t('config.city'),
                                prop: "city",
                                input: "input",
                            },
                            {
                                label: this.$t('config.provice'),
                                prop: "state",
                                input: "input",
                            },
                            {
                                label: this.$t('config.postcode'),
                                prop: "zip",
                                input: "input",
                            },
                        ],
                        url: `/queryStorer/5/?/${this.$store.state.wms}`,
                        disabled: true
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'1'}),
                        props: "selleraddress1",
                        disabled: true
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'2'}),
                        props: "selleraddress2",
                        disabled: true
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'3'}),
                        props: "selleraddress3",
                        disabled: true
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'4'}),
                        props: "selleraddress4",
                        disabled: true
                    },
                ],
                [
                    {
                        type: "input",
                        label: this.$t('config.city'),
                        props: "sellercity",
                        disabled: true
                    },
                    {
                        type: "input",
                        label: this.$t('config.provice'),
                        props: "sellerstate",
                        disabled: true
                    },
                    {
                        type: "input",
                        label: this.$t('config.postcode'),
                        props: "sellerzip",
                        disabled: true
                    },
                    {
                        type: "input",
                        label: this.$t('in.sellervat'),
                        disabled: true,
                        props: "sellervat"
                    }
                ]
            ],
        }
    },
    methods: {
        setData(data, id, close, listId) {
            this.inputData.sellername = data.storerkey;
            this.inputData.sellercity = data.city;
            this.inputData.sellerstate = data.state;
            this.inputData.sellerzip = data.zip;
            close(false);
        }
    },
    mounted() {
    },
    components: {
        'v-details': details
    }
}
</script>

<style scoped>

</style>

